package com.koala.work;

import com.google.common.base.Splitter;
import com.google.common.collect.Sets;
import org.junit.Test;

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author yantingrui
 * @date 2022/7/1   10:54
 */
public class Start {
    /**
     *
     */
    @Test
    public void test12() {
        String s = "123,12312";
        Set<Integer> collect = Splitter.on(',').splitToList(s).stream().map(Integer::parseInt).collect(Collectors.toSet());
        System.out.println(collect);
    }

    /**
     *
     */
    @Test
    public void test32() {
        Integer id = -1;
        Integer integer = Optional.ofNullable(id).filter(i -> i > 0).orElse(0);
        System.out.println(integer);
    }

    /**
     *
     */
    @Test
    public void test29() {
        HashSet<Long> longs = Sets.newHashSet(12L, 151L);
        System.out.println(longs);
    }
}
